import request from '@/utils/request'

export default{
    //获取物品列表接口
    //POST /service_manage/res/ResPageQuery/{page}/{limit}
    getProductList(token, page,limit){
        return request({
            params:{token:token},
            url:(`/service_manage/res/ResPageQuery/${page}/${limit}`),
            method:"post"

        })
    },

    //POST /service_manage/res/modifyRes
    //编辑物品
    //POST /service_manage/res/addRes
    //发布物品
    addOrUpdate(token,prolist){
        if(prolist.userId){
            return request({
                params:{token:token},
                url:(`/service_manage/res/modifyRes`),
                data:prolist,
                method:'post',
            })
            // return request.post('/manage_system/user-wechat/modifyUserWechat',userlist,params=getToken())
        }else{
            return request({
                params:{token:token},
                url:(`/service_manage/res/addRes`),
                data:prolist,
                method:'post',
            })
        }
    },

    //删除物品
    //DELETE /service_manage/res/deleteRes
    deletePro(token,resId){
        // return request.delete(`/admin/product/baseTrademark/remove/${id}`)
        // alert(openId)
        return request({
            // params:{token:token},
            params:{token:token,resId:resId},
            url:(`/service_manage/res/deleteRes`),
            method:'delete'

        })
    },
}